package com.gjx.springboot.app.service.impl;

import com.gjx.springboot.app.service.JobsService;
import com.gjx.springboot.infra.mapper.JobsMapper;
import com.gjx.springboot.domain.entity.Jobs;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class JobsServiceImpl implements JobsService {
    @Autowired
    JobsMapper jobsMapper;
    @Override
    public List<Jobs> getAllJobs() {
        List<Jobs> allJobs = jobsMapper.getAllJobs();
        return allJobs;
    }

    @Override
    public Boolean insertOneJob(Jobs jobs) {
        Boolean aBoolean = jobsMapper.insertOneJob(jobs);
        return aBoolean;
    }

    @Override
    public Boolean deleteOneJob(String jobId) {
        Boolean aBoolean = jobsMapper.deleteByJobId(jobId);
        return aBoolean;
    }

    @Override
    public Boolean updateOneJob(Jobs jobs) {
        Boolean aBoolean = jobsMapper.updateJobId(jobs);
        return aBoolean;
    }
}
